Fix SMP save/restore for 1 vcpu by adding suspend/resume functions for SMP.
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Tue, 2 Aug 2005 19:08:28 +0000 (19:08 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Tue, 2 Aug 2005 19:08:28 +0000 (19:08 +0000)
We have to free_irq the irq vectors for the SMP ipi vectors.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c
linux-2.6-xen-sparse/arch/xen/kernel/reboot.c

index 485fc6abcf38ab26c67479c2a7f21b0fea9fbcd5..f8ef335b6bc2e1024d0ddbcde3b4611085afc220 100644 (file)
@@ -1529,7 +1529,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
 extern irqreturn_t smp_reschedule_interrupt(int, void *, struct pt_regs *);
 extern irqreturn_t smp_call_function_interrupt(int, void *, struct pt_regs *);
 
-void __init smp_intr_init(void)
+void smp_intr_init(void)
 {
        int cpu = smp_processor_id();
 
@@ -1546,3 +1546,24 @@ void __init smp_intr_init(void)
                           smp_call_function_interrupt,
                           SA_INTERRUPT, callfunc_name[cpu], NULL));
 }
+
+static void smp_intr_exit(void)
+{
+       int cpu = smp_processor_id();
+
+       free_irq(per_cpu(resched_irq, cpu), NULL);
+       unbind_ipi_from_irq(RESCHEDULE_VECTOR);
+
+       free_irq(per_cpu(callfunc_irq, cpu), NULL);
+       unbind_ipi_from_irq(CALL_FUNCTION_VECTOR);
+}
+
+void smp_suspend(void)
+{
+       smp_intr_exit();
+}
+
+void smp_resume(void)
+{
+       smp_intr_init();
+}
index 99f679c00f8d7de23c3210d5094771e976077f22..5c99babb2679509a2cb788eca598146975f0d502 100644 (file)
@@ -91,6 +91,10 @@ static void __do_suspend(void)
 #define gnttab_resume()  do{}while(0)
 #endif
 
+#ifdef CONFIG_SMP
+    extern void smp_suspend(void);
+    extern void smp_resume(void);
+#endif
     extern void time_suspend(void);
     extern void time_resume(void);
     extern unsigned long max_pfn;
@@ -115,6 +119,10 @@ static void __do_suspend(void)
 
     time_suspend();
 
+#ifdef CONFIG_SMP
+    smp_suspend();
+#endif
+
     xenbus_suspend();
 
     ctrl_if_suspend();
@@ -158,6 +166,10 @@ static void __do_suspend(void)
 
     xenbus_resume();
 
+#ifdef CONFIG_SMP
+    smp_resume();
+#endif
+
     time_resume();
 
     blkdev_resume();